﻿<UserControl x:Class="RSSReader.MobileClient.View.FeedSelector"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:src="clr-namespace:RSSReader.MobileClient.View"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    >

    <Grid x:Name="LayoutRoot">
        <Grid.Resources>
            <Style x:Key="borderStyle" TargetType="Border">
                <Setter Property="BorderBrush" Value="Gray" />
                <Setter Property="BorderThickness" Value="1" />
                <Setter Property="Padding" Value="1" />
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="28"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="30"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="30"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="80"/>
            </Grid.ColumnDefinitions>
            <TextBlock Text="Delete" Grid.Column="0" HorizontalAlignment="Center"/>
            <TextBlock Text="Feed" Grid.Column="1" HorizontalAlignment="Center"/>
        </Grid>
        <ListBox x:Name="FeedList" ItemsSource="{Binding Feeds}" Grid.Row="1">
                <ListBox.ItemTemplate>
                <DataTemplate>
                    <Border Style="{StaticResource borderStyle}" CornerRadius="0">
                        <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="100"/>
                            <ColumnDefinition Width="300"/>
                            <ColumnDefinition Width="80"/>
                        </Grid.ColumnDefinitions>
                            <!--<Button x:Name="DeleteFeed" Content="-" BorderThickness="0" Click="{Binding DeleteDataCommand}" Grid.Column="0" DataContext="{Binding Path=Feedvm}"/>-->
                            <HyperlinkButton x:Name="DeleteLink" Content="-" BorderThickness="0" Grid.Column="0" NavigateUri="{Binding Path=deleteLink, Mode=OneWay}"/>
                        <!--<Name="Unread" Text="{Binding Path=UnreadNb, Mode=TwoWay}" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" />-->
                        <TextBlock x:Name="Name" TextTrimming="WordEllipsis" Text="{Binding Path=FeedName, Mode=TwoWay}" Grid.Column="1" VerticalAlignment="Center" />
                            <HyperlinkButton x:Name="FollowFeed" NavigateUri="{Binding Path=Link, Mode=TwoWay}" Click="FollowFeed_Click" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" Content="Go" Foreground="Black"  >
                                <HyperlinkButton.Background>
                                    <ImageBrush Stretch="Fill" ImageSource="/Images/transport.play.png"/>
                                </HyperlinkButton.Background>
                            </HyperlinkButton>
                        </Grid>
                    </Border>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</UserControl>